<!DOCTYPE html>
<html>
<head>
    <meta charset="UTF-8">
    <style>
        body {
            width: 600px;
            margin: 0;
            padding: 0;
            font-family: "Microsoft YaHei", sans-serif;
            background-color: #1a1a2e; /* 深蓝色背景，营造神秘感 */
            display: flex;
            flex-direction: column;
            height: 600px;
            color: #e6e6e6; /* 浅色文字，提高可读性 */
        }

        .chat-container {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
            background-color: #16213e; /* 深蓝紫色背景 */
        }

        .message {
            margin-bottom: 20px;
            max-width: 80%;
            display: flex;
            align-items: flex-start;
        }

        .message.ai {
            margin-right: auto;
        }

        .message.user {
            margin-left: auto;
            flex-direction: row-reverse;
        }

        .avatar {
            width: 40px;
            height: 40px;
            border-radius: 50%;
            margin: 0 10px;
            flex-shrink: 0;
        }

        .avatar img {
            width: 100%;
            height: 100%;
            border-radius: 50%;
        }

        .avatar svg {
            width: 100%;
            height: 100%;
            border-radius: 50%;
            background-color: #0f3460; /* 深蓝色背景 */
        }

        .message-content {
            background-color: #0f3460; /* 深蓝色背景 */
            padding: 15px;
            border-radius: 8px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
            transition: all 0.3s ease;
        }

        .message.user .message-content {
            background-color: #7b2cbf; /* 紫色背景，代表神秘和梦境 */
            color: white;
            box-shadow: 0 2px 10px rgba(123,44,191,0.3);
        }

        .text {
            font-size: 14px;
            line-height: 1.5;
        }

        .input-container {
            padding: 20px;
            background-color: #1a1a2e; /* 与body背景一致 */
            border-top: 1px solid #2a2a4a; /* 深色边框 */
            display: flex;
            align-items: center;
            position: relative;
        }

        .dream-input {
            flex: 1;
            padding: 12px;
            border: 1px solid #2a2a4a;
            border-radius: 8px;
            font-size: 14px;
            resize: none;
            outline: none;
            height: 24px;
            margin-right: 10px;
            background-color: #0f3460; /* 深蓝色背景 */
            color: #e6e6e6; /* 浅色文字 */
        }

        .dream-input::placeholder {
            color: #8d8daa; /* 淡紫色占位符 */
        }

        .submit-button {
            padding: 8px 20px;
            background-color: #7b2cbf; /* 紫色按钮 */
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
            height: 36px;
            min-width: 80px;
            transition: all 0.3s ease;
        }

        .submit-button:hover {
            background-color: #9d4edd; /* 亮紫色 */
            box-shadow: 0 0 15px rgba(157,78,221,0.5);
        }

        .submit-button:disabled {
            background-color: #4a4a6a; /* 灰紫色 */
            cursor: not-allowed;
        }

        .dream-input:disabled {
            background-color: #2a2a4a; /* 深灰色 */
            cursor: not-allowed;
        }

        /* 添加加载动画样式 */
        .loading-dots:after {
            content: '';
            animation: dots 1.5s steps(5, end) infinite;
        }

        @keyframes dots {
            0%, 20% { content: ''; }
            40% { content: '.'; }
            60% { content: '..'; }
            80%, 100% { content: '...'; }
        }

        /* 优化消息气泡样式 */
        .message-content {
            box-shadow: 0 2px 10px rgba(0,0,0,0.3);
            transition: all 0.3s ease;
        }

        .message.user .message-content {
            background-color: #7b2cbf; /* 紫色背景 */
            color: white;
            box-shadow: 0 2px 10px rgba(123,44,191,0.3);
        }

        /* 添加滚动条样式 */
        .chat-container::-webkit-scrollbar {
            width: 6px;
        }

        .chat-container::-webkit-scrollbar-track {
            background: #0f3460; /* 深蓝色 */
        }

        .chat-container::-webkit-scrollbar-thumb {
            background: #7b2cbf; /* 紫色 */
            border-radius: 3px;
        }

        .chat-container::-webkit-scrollbar-thumb:hover {
            background: #9d4edd; /* 亮紫色 */
        }

        .header {
            display: flex;
            justify-content: flex-end;
            padding: 10px;
            background-color: #1a1a2e; /* 与body背景一致 */
            border-bottom: 1px solid #2a2a4a; /* 深色边框 */
        }

        .clear-button {
            padding: 6px 12px;
            background-color: #0f3460; /* 深蓝色背景 */
            border: 1px solid #2a2a4a;
            border-radius: 4px;
            color: #e6e6e6; /* 浅色文字 */
            cursor: pointer;
            font-size: 12px;
            transition: all 0.3s ease;
        }

        .clear-button:hover {
            background-color: #1a508b; /* 亮蓝色 */
            color: white;
        }
    </style>
</head>
<body>
    <div class="header">
        <button id="clearButton" class="clear-button"></button>
    </div>
    <div class="chat-container" id="chatBox">
        <div class="message ai">
            <div class="avatar">
                <img src="images/icon48.png" alt="AI">
            </div>
            <div class="message-content">
                <div class="text">
                    <span id="welcomeText"></span>
                </div>
            </div>
        </div>
    </div>

    <div class="input-container">
        <input type="text" id="userInput" class="dream-input">
        <button id="sendButton" class="submit-button"></button>
    </div>

    <script src="js/chat.js"></script>
</body>
</html> 